package com.redrose.camera.main;

import android.annotation.SuppressLint;
import android.os.Bundle;
import android.view.MenuItem;
import android.widget.Toast;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.lifecycle.ViewModelProvider;
import androidx.navigation.NavController;
import androidx.navigation.Navigation;
import androidx.navigation.ui.NavigationUI;

import com.google.android.material.bottomnavigation.BottomNavigationView;
import com.redrose.camera.R;
import com.redrose.camera.databinding.ActivityMainBinding;
import com.redrose.camera.base.BaseActivity;

public class MainActivity extends BaseActivity<ActivityMainBinding> {

    private NavController controller;
    private BottomNavigationView bottomNavigationView;
    private MainViewModel mMainViewModel;

    @Override
    protected void initObserver() {

    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mMainViewModel = new ViewModelProvider(this).get(MainViewModel.class);
    }

    @Override
    protected void initConfigs() {
    }

    @Override
    protected void initView() {
        bottomNavigationView = mBinding.bottomLayout;
        controller = Navigation.findNavController(this,R.id.fragment_container);
        NavigationUI.setupWithNavController(bottomNavigationView, controller);
//        bottomNavigationView.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() {
//            @Override
//            public boolean onNavigationItemSelected(@NonNull MenuItem item) {
//                int itemId = item.getItemId();
//                if (itemId == R.id.firstFragment){
//
//                }
//                if (itemId == R.id.secondFragment){
//
//                }
//                if (itemId == R.id.thirdragment){
//
//                }
//                return false;
//            }
//        });


    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_main;
    }

    @Override
    public void onBackPressed() {
        super.onBackPressed();
    }
}